/*
 * @Description: 查看申请弹窗
 * @Author: Rfan
 * @Date: 2022-02-24 16:16:12
 * @LastEditTime: 2022-05-25 08:55:50
 */

import { Button, Modal } from 'antd';
import type { ICommonDialog } from '@/interfaces/global';
import { ITaskProcessResolve } from '@/api/workFlow/task';
import ReactBpmn from '@/components/Bpmn';

interface IProcessDialogProps extends ICommonDialog {
  data: ITaskProcessResolve;
}

const ProcessDialog = (props: IProcessDialogProps) => {
  const { visible, data, onClose } = props;

  /**
   * @description: 关闭借阅详情弹窗
   */
  const onCancel = () => {
    onClose();
  };

  return (
    <Modal
      title="审核流程"
      visible={visible}
      width={800}
      destroyOnClose
      onCancel={onCancel}
      footer={[
        <Button key="submit" type="primary" onClick={onCancel}>
          确定
        </Button>
      ]}
    >
      <ReactBpmn readOnly xml={data.xml} activeList={data.list.map((item) => item.activityId)} />
    </Modal>
  );
};

export default ProcessDialog;
